<?php

class SpielwieseController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
       $this->view->form = $this->getForm();
    }


    public function getForm() {
        $form = new Zend_Form();
      
              
       $decorator = new My_Decorator();
     
      
       $gender = new Zend_Form_Element_Radio('gender');

       $genders = array ('female' => 'Female','gaga'=>'gugu');
       
$gender->setLabel('Gender:')

->addMultiOptions($genders)
->setSeparator('-');
/*
$label = $gender->getMultiOption('male');
$label=$label->getDecorator('label');

$label->setOption('placement', 'append');
*/

    
 
       /*
       $radio2 = new Zend_Form_Element_Radio('foo', array(
    'label'      => 'Foo',
    'belongsTo'  => 'bar',
    'value'      => 'test',
    //'decorators' => array($decorator),
           
           )); 
       */
      
       $form->addElement($gender);
            return $form;
      $test= $this->element->getElement('gender')->getMultiOptions();
        Zend_Debug::dump($test);  
    }
    
}



class My_Decorator extends Zend_Form_Decorator_Abstract
    {
        protected $_format = '<label for="%s">%s</label>
            <input id="%s" name="%s" type="text" value="%s"/>';
     
        public function render($content)
        {
            $element = $this->getElement();
            $name    = htmlentities($element->getFullyQualifiedName());
            $label   = htmlentities($element->getLabel());
            $id      = htmlentities($element->getId());
            $value   = htmlentities($element->getValue());   
            $markup  = sprintf($this->_format, $name, $label, $id, $name, $value);
            return $markup;
        }
    }